Learn R Programming

adegenet (version 1.3-2)

Auxiliary functions: Utilities functions for adegenet

Description

These functions are mostly auxiliary procedures used internally in adegenet, with the exception of adegenetWeb, which opens the adegenet website in the default navigator. The other functions are: - checkType: checks the type of markers being used in a function and issues an error if appropriate. - .rmspaces: remove peripheric spaces in a character string. - .genlab: generate labels in a correct alphanumeric ordering. - .readExt: read the extension of a given file. - corner: adds text to a corner of a figure. - num2col: translates a numeric vector into colors. - transp: adds transparency to a vector of colors. Note that transparent colors are not supported on some graphical devices.

Usage

adegenetWeb()
.genlab(base, n)
corner(text, posi="topleft",  inset=0.1, ...)
num2col(x, col.pal=heat.colors, reverse=FALSE,
               x.min=min(x), x.max=max(x), na.col="green")
transp(col, alpha=.5)

Arguments

base
a character string forming the base of the labels
n
the number of labels to generate
text
a character string to be added to the plot
posi
a character matching any combinations of "top/bottom" and "left/right".
inset
a vector of two numeric values (recycled if needed) indicating the inset, as a fraction of the plotting region.
...
further arguments to be passed to text
x
a numeric vector
col.pal
a function generating colors according to a given palette.
reverse
a logical stating whether the palette should be inverted (TRUE), or not (FALSE, default).
x.min
the minimal value from which to start the color scale
x.max
the maximal value from which to start the color scale
na.col
the color to be used for missing values (NAs)
col
a vector of colors
alpha
a numeric value between 0 and 1 representing the alpha coefficient; 0: total transparency; 1: no transparency.

Value

  • For .genlab, a character vector of size "n".

encoding

UTF-8

Examples

Run this code
## this opens the adegenet website
adegenetWeb()

.genlab("Locus-",11)

## transparent colors using "transp"
plot(rnorm(1000), rnorm(1000), col=transp("blue",.3), pch=20, cex=4)


## numeric values to color using num2col
plot(1:100, col=num2col(1:100), pch=20, cex=4)
plot(1:100, col=num2col(1:100, col.pal=rainbow), pch=20, cex=4)

Run the code above in your browser using DataLab